#ifndef _BASE_MJ_CARD_H_
#define _BASE_MJ_CARD_H_

class MJCard
{
public:
    
    enum {
        E_MJCard_Invalid = 0, // 无效牌
        E_MJ_POINT_MIN = 1,
        E_MJ_POINT_MAX = 9,
    };

    enum EMJCardType
    {
        E_MJCard_TP_Wan     = 0,
        E_MJCard_TP_Tiao    = 1,
        E_MJCard_TP_Tong    = 2,
        E_MJCard_TP_Zi      = 3,
        E_MJCard_TP_Hua     = 4,
        E_MJCard_TP_Count,
    };
  

    static bool IsValid(unsigned char c)
    {
        int t = c/10, v = c%10;     
        return (t < E_MJCard_TP_Count) && (v >= E_MJ_POINT_MIN && v <= E_MJ_POINT_MAX);
    }

    static unsigned char CardPoint(unsigned char c)
    {
        return c%10;      
    }

    static unsigned char CardType(unsigned char c)
    {
        return c/10;     
    }

    static unsigned char Card2Num(unsigned char c)
    {
        return c;     
    }

    static unsigned char Num2Card(unsigned char c)
    {
        return c;     
    }
};


#endif

